package groep1.graph;

import groep1.graph.graphstrategy.layout.GraphPlacementStrategy;
import groep1.graph.graphstrategy.line.LineStrategy;

import java.util.Collection;

/**
 * A mediator which allows the components of the graph work together, while
 * promoting loose coupeling.
 * 
 * @author Niels Billen
 * @version 0.1
 * @since 0.1
 */
public interface GraphMediator {
	/**
	 * Called when the dimension of the graph has changed.
	 * 
	 * @param width
	 *            The width of the graph.
	 * @param height
	 *            The height of the graph.
	 */
	public void dimensionChanged(int width, int height);

	/**
	 * Relayout the graph with the given minimum seperation between the objects
	 * 
	 * @param addedHorizontalSeperation
	 *            The amount of extra horizontal seperation between the objects.
	 * @param addecVerticalSeperation
	 *            The amount of extra vertical seperation between the objects.
	 */
	public void relayout(int addedHorizontalSeperation,
			int addecVerticalSeperation);

	/**
	 * Sets the objects of the graph to the given objects.
	 * 
	 * @param objects
	 *            The objects for the graph.
	 * @throws NullPointerException
	 *             When the given objects are null.
	 */
	public void setGraphObjects(Collection<GraphObject> objects)
			throws NullPointerException;

	/**
	 * Returns the objects of the graph.
	 * 
	 * @return the objects of the graph.
	 */
	public Collection<GraphObject> getGraphObjects();

	/**
	 * Sets the line strategy for this mediator.
	 * 
	 * @param strategy
	 *            The line strategy for this mediator.
	 * @throws NullPointerException
	 *             When the given strategy is null.
	 */
	public void setLineStrategy(LineStrategy strategy)
			throws NullPointerException;

	/**
	 * Returns the line strategy of this mediator.
	 * 
	 * @return the line strategy of this mediator.
	 */
	public LineStrategy getLineStrategy();

	/**
	 * Sets the placement strategy for this mediator.
	 * 
	 * @param strategy
	 *            The placement strategy for this mediator.
	 * @throws NullPointerException
	 *             When the given strategy is null.
	 */
	public void setGraphPlacementStrategy(GraphPlacementStrategy strategy)
			throws NullPointerException;

	/**
	 * Returns the graph placement strategy of this mediator.
	 * 
	 * @return the graph placement strategy of this mediator.
	 */
	public GraphPlacementStrategy getGraphPlacementStrategy();
}
